﻿using Jint;
using Jint.Runtime.Debugger;
using System;
using System.Collections.Generic;
using T.FAS.Runtime.Expression.Entity;
using T.FAS.Runtime.Expression.Service;

namespace T.FAS.Runtime.Expression.SGSPI
{
    public interface ISGExprService
    {
        /// <summary>
        /// 调试表达式
        /// </summary>
        /// <returns></returns>
        Dictionary<string, object> Debug(string expr, Dictionary<string, object> inputParam);
        /// <summary>
        /// 执行表达式
        /// </summary>
        /// <returns></returns>
        ExprResult JSExecute(string expr, Dictionary<string, object> inputParam);
        /// <summary>
        /// 表达式通用接口
        /// </summary>
        /// <returns></returns>
        Dictionary<string, object> ExecutePlugin(string actionCode, Dictionary<string, object> param);
        /// <summary>
        /// 表达式调试
        /// </summary>
        /// <returns></returns>
        void DebugExpr(string expr, Dictionary<string, object> inputParam, string sessionID);
        /// <summary>
        /// 停止调试
        /// </summary>
        /// <returns></returns>
        void StopDebug(string sessionID);
        /// <summary>
        /// 继续调试
        /// </summary>
        /// <returns></returns>
        void ContinueDebug(string sessionID, StepMode stepMode);
        /// <summary>
        /// 获取调试信息
        /// </summary>
        /// <returns></returns>
        DebugInfo GetDebugInfo(string sessionID);
    }
}
